package com.zlsy.thread.threadlocal;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author zhouliang
 * @date 2020/07/11
 **/
public class ThreadLocalNormalUsage00 {

    public String date(int seconds) {
        Date date = new Date(1000 * seconds);
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        return simpleDateFormat.format(date);
    }

    public static void main(String[] args) {
        Thread thread = new Thread(
                new Runnable() {
                    @Override
                    public void run() {
                        String date = new ThreadLocalNormalUsage00().date(10);
                        System.out.println(date);
                    }
                }
        );

        Thread thread1 = new Thread(
                new Runnable() {
                    @Override
                    public void run() {
                        String date = new ThreadLocalNormalUsage00().date(2132);
                        System.out.println(date);
                    }
                }
        );

        thread.start();
        thread1.start();
    }
}
